#!/bin/bash
set -e
# set -x

# 生成版本号 如 1.2.3
if [ -z "$1" ]; then
    echo "请输入版本号 如 1.2.3"
    exit 1
fi
version=$1
go build -o backup
docker build --platform=linux/amd64 -t registry.cn-hangzhou.aliyuncs.com/zhiyizhao/backup:$version .
docker push registry.cn-hangzhou.aliyuncs.com/zhiyizhao/backup:$version